#!/bin/bash


if [ "-z $1" -o "-z $2" ]; then
    echo "帮助：$0 </var/log/file1> </opt/log/file2>"
    exit 13
fi

file1=$1
file2=$2

#md5_file1="$(md5sum "$file1")"
#md5_file2="$(md5sum "$file2")"



#left=($(${md5_file1} | awk '{print $1}'))
#right=($(${md5_file2} | awk '{print $1}'))

left=($(md5sum ${file1} | awk '{print $1}'))
right=($(md5sum ${file2} | awk '{print $1}'))


if [ "$left" == "$right" ]; then
    echo "这两个文件内容一致，复制成功"
else
    echo "这两个文件存在差异，请检查文件内容"
fi
